<template>
	<div class="answer-actions">
		<template v-if="data.agree && data.agress !== 0">
			<span>{{data.agree}}</span>·
		</template>
		<template v-if="data.comments && data.comments !== 0">
			<span>{{data.comments}}</span>
		</template>
		
		<template v-if="type === 'question'">
			·<a v-on:click="focus(data.id)">{{data.isFocus ? '已关注' : '关注问题'}}</a>
		</template>
		<template v-if="type === 'roundTable'">
			·<a v-on:click="focus(data.id)">{{data.isFocus ? '已关注' : '关注圆桌'}}</a>
		</template>
		<template v-if="type === 'shareList'">
			·<a v-bind:href="data.goto">去往分享列表</a>
		</template>
	</div>
</template>
<script>
	export default {
		props: {
			'data': {
				type: Object
			},
			'type': {
				type: String,
				default: 'question',
				validator: (value) => {
					return ['none', 'question', 'roundTable', 'shareList'].indexOf(value) > -1 ? true : false;
				}
			}
		},
		methods: {
			focus (id) {
				this.data.isFocus = !this.data.isFocus;
			}
		}
	}
</script>
<style lang="less" scoped>
	.answer-actions {
		color: #999;
	}
</style>
